#include <iostream>

using namespace std;

int ans = 0;
int n;

int gcd(int x, int y)
{
	return y == 0 ? x : gcd(y, x % y);
}

int main()
{
	cin >> n;
	for(int i = 1; i <= n; i++)
	{
		int x; cin >> x;
		ans = gcd(ans, abs(x));
	}
	cout << ans << endl;
	return 0;
 } 
